package com.galudisu.comm

import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
import spray.json.{DefaultJsonProtocol, RootJsonFormat}

/**
  * @author galudisu
  */
trait JsonProtocol extends SprayJsonSupport with DefaultJsonProtocol {

  // REST 定义
  implicit lazy val jobSuccess: RootJsonFormat[JobSuccess] = jsonFormat1(JobSuccess)
  implicit lazy val jobFailure: RootJsonFormat[JobFailure] = jsonFormat1(JobFailure)

  // 业务对象
  implicit lazy val logarithmCalcJob: RootJsonFormat[LogarithmCalcJob] = jsonFormat1(LogarithmCalcJob)

}
